package com.test.study.ToolsUtils;

import com.alibaba.fastjson.JSON;
import com.test.study.ToolsUtils.bean.User;

import scala.util.Random;

public class App 
{
	/**
	 *{"index":{"_index":"users","_type":"user","_id":"1"}}
	 * huyong
	 * @param args
	 * 2019年3月15日
	 */
    public static void main( String[] args )
    {
    	 Random random = new Random(100);
    	for(int i=0;i<1000;i++) {
    		String sex="man";
    		if(i%2==0) {
    			sex="woman";
    		}
    		int nextInt = random.nextInt(100);
    		User user=new User("张三", "desc"+nextInt,nextInt, sex);
    		System.out.println("{\"index\":{\"_id\":"+(i+1)+"}}");
    		String jsonString = JSON.toJSONString(user);
    		System.out.println(jsonString);
    	}
    }
}
